import service from '@/utils/request'

export function getExamListService(params) {
  return service({
    url: "/exam/listHomework",
    method: "get",
    params,
  });
}

export function examAddService(params = {}) {
  return service({
    url: "/exam/addHomework",
    method: "post",
    data: params,
  });
}

export function addExamQuestionService(params = {}) {
  return service({
    url: "/exam/question/add",
    method: "post",
    data: params,
  });
}

export function getExamDetailService(examId) {
  return service({
    url: "/exam/detail",
    method: "get",
    params: { examId },
  });
}

export function editExamService(params = {}) {
  return service({
    url: "/exam/editHomework",
    method: "put",
    data: params,
  });
}

export function delExamQuestionService(examId, questionId) {
  return service({
    url: "/exam/question/delete",
    method: "delete",
    params: { examId, questionId },
  });
}

export function delExamService(examId) {
  return service({
    url: "/exam/deleteHomework",
    method: "delete",
    params: { examId },
  });
}

export function publishExamService(examId) {
  return service({
    url: "/exam/publishHomework",
    method: "put",
    params: { examId },
  });
}

export function cancelPublishExamService(examId) {
  return service({
    url: "/exam/cancelPublishHomework",
    method: "put",
    params: { examId },
  });
}

export function getHomeworkUserDTOService(examId) {
  return service({
    url: '/exam/getHomeworkQuestionVO',
    method: 'get',
    params: { examId }
  })
}

export function getHomeworkUserDTOListService(questionId, courseId, examId) {
  return service({
    url: '/exam/getHomeworkUserDTO',
    method: 'get',
    params: { questionId, courseId, examId }
  });
}

export function getHomeworkScoreService(examId, courseId) {
  return service({
    url: '/exam/getHomeworkScore',
    method: 'get',
    params: { examId, courseId }
  });
}